

function moveField(unSelectedComs,selectedComs){
    var unSelectedComs = document.getElementById(unSelectedComs);
    var selectedComs = document.getElementById(selectedComs);
    
    var delIndexArr=new Array();
    var j=0;
    for(var i=0;i<unSelectedComs.length;i++){
        if(unSelectedComs.options[i].selected == true){           
          var TempOption=new Option(unSelectedComs.options[i].text,unSelectedComs.options[i].value)
          selectedComs[selectedComs.length]=TempOption;
          delIndexArr[j]=unSelectedComs.options[i].value;
          j++;
        }
    }
    
   for(var m=0;m<delIndexArr.length;m++){
   	for(var n=0;n<unSelectedComs.length;n++){
   		  if(delIndexArr[m]==unSelectedComs.options[n].value){
   		    unSelectedComs.options.remove(n);
   		  }
   		}
    }            
}

function moveAllField(unSelectedComs,selectedComs) {
	var unSelectedComs = document.getElementById(unSelectedComs);
	var selectedComs = document.getElementById(selectedComs);
	var delIndexArr = new Array();
	var j = 0;
	for (var i = 0; i < unSelectedComs.length; i++) {
		var TempOption = new Option(unSelectedComs.options[i].text, unSelectedComs.options[i].value)
		selectedComs[selectedComs.length] = TempOption;
		delIndexArr[j] = unSelectedComs.options[i].value;
		j++;
	}

	for (var m = 0; m < delIndexArr.length; m++) {
		for (var n = 0; n < unSelectedComs.length; n++) {
			if (delIndexArr[m] == unSelectedComs.options[n].value) {
				unSelectedComs.options.remove(n);
			}
		}
	}
}